import { SetMetadata } from '@nestjs/common';

export const IS_PUBLIC_KEY = 'isPublic';
export const Public = () => SetMetadata(IS_PUBLIC_KEY, true);

// export const IS_REQUIRE_LOGIN = 'requireLogin';
// export const RequireLogin = () => SetMetadata(IS_REQUIRE_LOGIN, true);

// export const RequirePermission = (...permissions: string[]) =>
//   SetMetadata('require-permission', permissions);

// export const UserInfo = createParamDecorator(
//   (data: string, ctx: ExecutionContext) => {
//     const request = ctx.switchToHttp().getRequest<Request>();

//     if (!request.user) {
//       return null;
//     }
//     return data ? request.user[data] : request.user;
//   },
// );
